<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<!-- 新 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" href="Public/Home/bootstrap/css/bootstrap.min.css">
        <script src="Public/Home/js/jquery-1.8.3.min.js"></script>
        <script src="Public/Home/bootstrap/js/bootstrap.min.js"></script>
        <script src="Public/Home/js/content.js"></script>
		<link rel="stylesheet" href="Public/Home/less/content.css" />
<!--	<link rel="stylesheet" href="./less/footer.css" />-->
		
	</head>
	<body>
		<div id="top_wrap">
			<div class='wrap'>
			<a href="" class="index_wrap">美丽说首页</a>
			<ul>
				<li><a href="" >客服服务</a></li>
				<li><a href="">我的订单</a></li>
				<li><a href="">购物车</a></li>
				<li><a href="">注册</a></li>
				<li><a href="">登录</a></li>
			</ul>
			</div>
		</div>
		
		<div id="search">
			<img src="Public/Home/img/logo.png" alt="" />
			<div>
				<input type="text"class="search_text" placeholder="输入你想要的商品……" />
				<span class="search_btn">搜索</span>
			</div>
		</div>
	<!--<div id='add_img'><img src="Public/Home/img/add.jpg" alt="" /></div>-->
      <div id='nav_box'>
		<div id="nav">
			<ul>
				<li>
					<a href="">首页</a>
					<a href="">最热</a>
					<a href="">上衣</a>
					<a href="">上衣</a>
					<a href="">上衣</a>
					<a href="">上衣</a>
					<a href="">上衣</a>
					<a href="">上衣</a>
				</li>
			</ul>
			<div class="nav_more"><a href="">全部商品</a></div>
			<div class="nav_fans"><a href="">热销新款</a></div>
		</div>
		</div>
	<div id='content_box'>
		<div class="content_left">
			<?php foreach ($goodsData as $k=>$v){?>
			<h2><?php echo $v['gname']?></h2>
			<?php }?>
			<div class='img_show'>
			  <div class='mid_img'>
			  <div class='mid_show'><img src="<?php echo $data1['big'][0]?>" alt=""rel="<?php echo $data1['big'][0]?>" class="jqzoom" style="width:360px;height: 468px;"/></div>
			  <div class="cover"></div>
			  <div class="kuai"></div>
			  </div>
			  <ul class='sm_img' id="thumblist">
				<li><img src="<?php echo $data1['big'][0]?>" alt=""mid="<?php echo $data1['big'][0]?>" big="<?php echo $data1['big'][0]?>" style="width:70px;height: 91px;"/></li>
				<li><img src="<?php echo $data1['big'][1]?>" alt=""mid="<?php echo $data1['big'][1]?>" big="<?php echo $data1['big'][1]?>" style="width:70px;height: 91px;"/></li>
				<li><img src="<?php echo $data1['big'][2]?>" alt=""mid="<?php echo $data1['big'][2]?>" big="<?php echo $data1['big'][2]?>" style="width:70px;height: 91px;"/></li>
			  </ul>
			</div>
			<div class='big_show'>
		        <img id="big_pic" src="<?php echo $data1['big'][0]?>" alt="" style="width:640px;height: 832px;"/>
			</div>
			<div class='left_info'>
				<div class='info_pr'>
					<?php foreach ($goodsData as $k=>$v){?>
					<span>原价：<del>￥<?php echo $v['marketprice']?></del></span>
					<span>现价：<b>￥<?php echo $v['shopprice']?></b></span>
					<?php }?>
				</div>
				 <div class="color_all">
				<?php foreach ($data as $k=>$v){?>
           
				<div class='info_color'>
					<dl class='color_num'>
						<dt><?php echo $v['taname']?>：</dt>
						<?php foreach ($v['sonData'] as $kk=>$vv){?>
						<dd gtid="<?php echo $vv['gtid']?>"><?php echo $vv['gtvalue']?><i></i></dd>
						<?php }?>
					</dl>
				</div>
				<?php }?>
			</div>

				<div class='info_num'>
					<span>数量：</span>
					<a href="javascript:void(0)" class='min'>-</a>
					<input type="text"  class='show_nom'placeholder="" value="1"/>
					<a href="javascript:void(0)" class='add'>+</a>
					<span>库存<i class='inventory'>0</i><?php echo $goodsData[0]['unit']?></span>
				</div>
				<div class='info_btn'>
					<a href="" id="now_buy">立即购买</a>
					<a href="javascript:void(0)" class='add_shop'>加入购物车</a>
				</div>
				<ul>
					<li class='s_first'>服务承诺:</li>
					<li> 退货补运费</li>
					<li>7天无理由退货</li>
					<li>先行赔付</li>
					<li>72小时发货</li>
				</ul>

			</div>
			
		</div>
		<div class='content_right'>
			<h2>热卖推荐</h2>
			<ul>
				<?php foreach ($hotData as $k=>$v){?>
				<li>
					<a href="<?php echo U('index',array('gid'=>$v['gid']))?>">
					<img src="<?php echo $v['pic']?>" alt="" style="width: 120px;height: 160px;"/>
					</a>
					<span>￥<?php echo $v['shopprice']?></span>
				</li>
				<?php }?>
			</ul>
		</div>
	</div>
	<div id="content_all">
		<div class="all_left">
			<p>全部分类</p>
			<ul>
				<?php foreach ($listData as $k=>$v){?>
				<li><span class="glyphicon glyphicon-search" aria-hidden="true"></span><a href=""><?php echo $v['tname']?></a></li>
				<?php }?>
			</ul>
		</div>
		<div class="all_center">
			<div class="center_nav">
				<a href="javascript:;">商品详情</a>
				<a href="javascript:;">商品评价</a>
				<!--<a href="">同类商品</a>-->
			</div>
			 <div class='center_con'>
			 	 <?php echo $data1['intro']?>
			 </div>
			 <div class='center_con cneter_hid'>
				<!--<?php echo $data1['intro']?>-->
				 <!-- 多说评论框 start -->
			<div class="ds-thread" data-thread-key="$dsData['gid']" data-title="$dsData['gname']" data-url="<?php echo U('Content/index',array('gid'=>$dsData['gid']))?>"></div>
				<!-- 多说评论框 end -->
				<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
				<script type="text/javascript">
				var duoshuoQuery = {short_name:"wrap"};
					(function() {
						var ds = document.createElement('script');
						ds.type = 'text/javascript';ds.async = true;
						ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
						ds.charset = 'UTF-8';
						(document.getElementsByTagName('head')[0] 
						 || document.getElementsByTagName('body')[0]).appendChild(ds);
					})();
					</script>
				<!-- 多说公共JS代码 end -->

			 </div>
			
		</div>
		<div class="all_right">
			<p>看了又看</p>
			<ul>
			<?php foreach ($lookData as $k=>$v){?>
				<li>
					<a href="<?php echo U('index',array('gid'=>$v['gid']))?>">
						<img src="<?php echo $v['pic']?>" alt="" />
					</a>
					<span>￥<?php echo $v['shopprice']?></span>
					<a href=""><?php echo $v['gname']?></a>
				</li>
			<?php }?>
        
			</ul>
		</div>
		
	</div>
	<div class='success'>
		<a href="javascript:void(0)" id='close'><span class="glyphicon glyphicon-remove" aria-hidden="true" ></span></a>
		<h4>提示:</h4>
		<p><span class="glyphicon glyphicon-ok" aria-hidden="true" ></span>&nbsp;&nbsp;已成功添加到购物车</p>
		<a href="" class='look'>再去逛逛</a>
		<a href="<?php echo U('Cart/index')?>" class='buy'>去购物车结算&nbsp;&nbsp;&nbsp;&nbsp;>></a>
	</div>
	</body>
<script>
	$(function(){
		
	$('.color_num dd').click(function(){
	$(this).addClass("selected").siblings().removeClass("selected");
//	aData=$(this).find('.selected').attr('gtid');
	str='';
	$.each($('.selected'), function(){
		str+=$(this).attr('gtid')+',';
	});
//	alert(str.length);
    if(str.length>3){
		$.ajax({
			url:"<?php echo U('selectsql')?>",
			type:'post',
			data :'combine=' + str,
			dataType:'json',
			success:function(data){
            	if(!data.nm){
					alert(data.info);
					$('.inventory').html(0);
					$('#now_buy').css({'background':'#999'});
					return false;
				}else{
					$('.inventory').html(data.info);
				}
			} 
		});
		}
//111111

	})
	})
	
	$(function(){
        $('.add_shop').click(function(){
        var str='';
        var count='';
        $.each($('.selected'), function(){
		str+=$(this).attr('gtid')+',';
	    });
	    count=$('.show_nom ').val();
//	    alert(count);
         $.ajax({
			url:"<?php echo U('Cart/addcart')?>",
			type:'post',
			data :'combine=' + str+'&count='+count,
			dataType:'json',
			success:function(data){
//				 alert(data.state);                                       
				if(!data.state){
					alert(data.info);
					return false;
				}
				if(data.state==1){
					$('.success').show();
//                    alert(data.state);
				}
			}
         });
    })
   $('#close').click(function(){
   	 $('.success').hide();
   })
		
})
</script>

</html>
